package enumerated;

import sun.rmi.runtime.Log;

import javax.swing.*;

import static enumerated.Outcome.*;

public enum  RoShamBo3 implements Competitor<RoShamBo3>{
    PAPER{
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor){
                default:
                case PAPER: return DRAW;
                case SCISSORS:return LOSE;
                case ROCK: return WIN;
            }
        }
    },
    SCISSORS{
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor){
                default:
                case PAPER:return WIN;
                case SCISSORS:return DRAW;
                case ROCK:return LOSE;
            }
        }
    },
    ROCK{
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor){
                default:
                case ROCK:return DRAW;
                case SCISSORS:return WIN;
                case PAPER:return LOSE;
            }
        }
    }
    ;
    public abstract Outcome compete(RoShamBo3 it);

    public static void main(String[] args) {
        RoShamBO.play(RoShamBo3.class,20);
    }
}
